// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
	"os"

	"istio.io/istio/pilot/cmd/pilot-discovery/app"
	"istio.io/pkg/log"
)

//discover在pilot主要扮演服务发现以及路由规则下发的角色
//服务发现后监听所有的服务和配置文件，当这些发送变化时触发xDS规则的下发
func main() {
	//pilot中discover的命令构建
	rootCmd := app.NewRootCommand()
	//执行命令
	if err := rootCmd.Execute(); err != nil {
		log.Error(err)
		os.Exit(-1)
	}
}
